<template>
  <div>
    <h3>Props传参</h3>
    {{ count }}
    <!-- <Child :count="count" :add="add" /> -->
    <!-- <Child  :count.sync="count"/> -->
    <Child v-model="count" />
  </div>
</template>

<script>
import Child from "./Child.vue";
export default {
  name: "Props",
  components: { Child },
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    add(value) {
      this.count += value;
    },
  },
  mounted() {
    // 找到自己的父组件
    console.log(this.$parent);
  },
};
</script>

<style>
</style>